<?php
//session_start();
$con = mysql_connect("127.0.0.1","root","");
	  
if (!$con) {
	error_log("Could not connect: " . mysql_error());
}

mysql_select_db("yeoldeguilde", $con);
$query = 'SELECT lastUpdated FROM information';
$result = mysql_query($query,  $con);			
$row = mysql_fetch_array($result);
$lastUpdated = $row['lastUpdated'];
$query = "SELECT id, banker, itemName, itemID, itemCount, color, icon FROM bankitems WHERE lastUpdated='".$lastUpdated."' ORDER BY banker DESC";
$result = mysql_query($query,  $con);	
$return = array();
while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    array_push($return, $row);
}
die (json_encode($return));
?>